<template>
	<!-- 销售记录的展示 -->
	<view class="">
		<!-- 销售记录的展示标题 -->
		<view style="display: flex;flex-direction: row;font-size: 27rpx;justify-content: space-around;width: 90%;margin: 10rpx auto;">
			<view style="display: flex;margin: 20rpx 0 0rpx 20rpx;flex: 3;justify-content: center;">
				商品
			</view>
			<view style="display: flex;margin: 20rpx 0 0rpx 20rpx;flex: 3;justify-content: center;">
				购买人
			</view>
			<view style="display: flex;margin: 20rpx 0 0rpx 20rpx;flex: 1;justify-content: center;">
				价格
			</view>
			<view style="display: flex;margin: 20rpx 0 0rpx 20rpx;flex: 1;justify-content: center;">
				数量
			</view>
			<view style="display: flex;margin: 20rpx 0 0rpx 20rpx;flex: 3;justify-content: center;">
				日期
			</view>
		</view>
		<view style="display: flex;padding: 20rpx 0; width: 90%;border-radius: 15rpx; margin: 10rpx auto;box-shadow: 1px 1px 5px #c2c2c2;flex-direction: column;" v-for="item in maihuomingxi"  :key=item._id :title="item.name">
			<view style="display: flex;width: 100%;flex-direction: row;font-size: 30rpx;align-content: center;">
				<view style="display: flex;margin: 10rpx 0 10rpx 20rpx ;flex: 3;justify-content: center;">
					{{item.shangpinname}}
				</view>
				<view style="display: flex;margin: 10rpx 0 10rpx 20rpx ;flex: 3;justify-content: center;">
					{{item.goumairen}}
				</view>
				<view style="display: flex;margin:10rpx 0 10rpx  20rpx ;flex: 1;justify-content: center;">
					{{item.jiage}}
				</view>
				<view style="display: flex;margin:10rpx 0 10rpx  20rpx ;flex: 1;justify-content: center;">
					{{item.goumaishuliang}}
				</view>
				<view style="display: flex;margin: 10rpx 0 10rpx  20rpx ;flex: 3;font-size: 25rpx;justify-content: center;">
					<uni-dateformat :date=(item.goumairiqi) format="yyyy-MM-dd hh:mm:ss" ></uni-dateformat>
				</view>
			</view>
			<view style="display: flex;margin:0rpx 0 10rpx  20rpx ;font-size: 27rpx;color: #c2c2c2;flex-direction: row;">
				<view >
					经手人:{{item.xiaoshouren}}
				</view>
				<view style="margin-left: 20rpx;">
					备注:{{item.beizhu}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				maihuomingxi:[]
			}
		},
		onLoad(option) {
			this.shu1 = JSON.parse(decodeURIComponent(option.xiaoqu));
			this.maihuomingxifun()
		},
		methods: {
			//获取本校区的卖货明细
			maihuomingxifun(){
				uni.showLoading({
					title: '卖货明细…',
					mask: true
				});
				uniCloud.callFunction({
					name:"funshare",
					data:{
						leixing:18,//类型为18时，获取本校区的销售明细
						xiaoqu:this.shu1,
					}
				}).then(res=>{
					this.maihuomingxi=res.result.data.reverse()
					uni.hideLoading()
				})
			},
		}
	}
</script>

<style>

</style>
